#ifndef _LED_H
#define _LED_H

#include "reg51.h"

//a    P0.1
//f    P0.2
//b    p0.5
//e    P0.6
//d    P0.7
//dp   P2.7
//c    P2.6
//g    P2.5

//0    a,b,c,d,e,f   P2    0100 0000    P0    1110 0110 
//1    b,c    P2    0100 0000    P1    0010 0000
//2    a,b,g,e,d    P2    0010 0000    P1 1110 0010
//3    a,b,g,c,d    P2    0110 0000    P1 1010 0010
//4    f,g,b,c    P2    0110 0000    P1 0010 0100
//5    a,f,g,c,d    P2    0110 0000    P1 1000 0110
//6    a,f,e,g,c,d    P2    0110 0000    P1 1100 0110
//7    a,b,c    P2    0100 0000    P1 0010 0010
//8    a,f,b,g,e,c,d    P2    0110 0000    P1 1110 0110
//9    a,f,b,g,c,d    P2    0110 0000    P1 1010 0110
//A    a,f,b,g,e,c,    P2    0110 0000    P1 0110 0110
//b    f,g,e,c,d    P2    0110 0000    P1 1100 0100
//c    a,f,e,d    P2    0000 0000    P1 1100 0110

//d    e,g,c,d,b    P2    0110 0000    P1 1110 0000
//E    a,f,g,e,d    P2    0010 0000    P1 1100 0110
//F    a,f,g,e    P2    0010 0000    P1 0100 0110

sbit LSA = P0^0;
sbit LSB = P0^3;
sbit LSC = P0^4;
sbit LSD = P2^4;

extern unsigned int code arrs[16];

void LedInit(unsigned char num) ;
void LedClear();
void display(unsigned int num,unsigned int bits);
void Show(unsigned int dat);
#endif